package ch4;

import java.util.Scanner;

public class ExchangePurchase {

	public static void main(String[] args) {
		// 换购
		Scanner in = new Scanner(System.in);
		System.out.println("购物金额：");
		double money = in.nextDouble();
		// 1:2,3:
		System.out.println("加一元换购可乐一瓶，加5元换洗衣液,加10元换洗面奶，20元换1okg面粉");
		String exchange = in.next();
		switch (exchange) {
		case "可乐":
			if (money >= 50) {
				money += 1;
				System.out.println("换购可乐一瓶");
			} else {
				System.out.println("不满足换购条件");
			}
			break;
		case "洗衣液":
			if (money >= 100) {
				money += 5;
				System.out.println("换购洗衣液一瓶");
			} else {
				System.out.println("不满足换购条件");
			}
			break;
		case "面粉":
			if (money >= 200) {
				money += 20;
				System.out.println("换购面粉一袋");
			} else {
				System.out.println("不满足换购条件");
			}
			break;
		default:
			System.out.println("不参与换购");
			break;
		}
		System.out.println("花费" + money + "元");
	}

}
